<?php
namespace  App\Http\Controllers;

use App\Model\Fg_admin;
use App\Model\Fg_cate;
use App\Model\Fg_keyword;
use App\Model\Http_account;

class PublicController
{

    /**
     * @param $mobile
     * @return mixed
     * 检测关键词是否存在
     */
    public function checkKeyExist($keyword)
    {
        return Fg_keyword::where('keyword',$keyword)->first();

    }

    /**
     * @param $token
     * @return mixed
     * 检测分类是否存在
     */
    static function checkCateExist($cate_name)
    {
        return Fg_cate::where('cate_name',$cate_name)->first();
    }

    /**
     * @param $mobile
     * @return mixed
     * 检测管理员是否存在
     */
    static function checkAdminExist($username)
    {
        return Fg_admin::where('username',$username)->first();
    }


    /**
     * @param $token
     * @return mixed
     * 根据token返回用户信息
     */
    static function check_token($token)
    {
        $users = Http_user::where('token',$token)->first();
        return $users;
    }



}





?>